package com.ikingtech.framework.sdk.sms.api;

import com.ikingtech.framework.sdk.core.response.R;
import com.ikingtech.framework.sdk.sms.model.SmsDTO;
import com.ikingtech.framework.sdk.sms.model.SmsQueryParamDTO;
import com.ikingtech.framework.sdk.sms.model.SmsSendMessageParamDTO;
import com.ikingtech.framework.sdk.sms.model.SmsTemplateDTO;
import com.ikingtech.framework.sdk.web.annotation.PostRequest;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author tie yan
 */
public interface SmsApi {

    @PostRequest(order = 1, value = "/add", summary = "新增", description = "新增，新增成功后返回编号。")
    R<String> add(@Parameter(name = "sms", description = "短信信息")
                  @RequestBody SmsDTO sms);

    @PostRequest(order = 2, value = "/delete", summary = "删除", description = "删除。")
    R<Object> delete(@Parameter(name = "id", description = "编号")
                     @RequestBody String id);

    @PostRequest(order = 3, value = "/update", summary = "更新", description = "更新。")
    R<Object> update(@Parameter(name = "sms", description = "短信信息")
                     @RequestBody SmsDTO sms);

    @PostRequest(order = 4, value = "/list/page", summary = "分页查询", description = "分页查询，没有查询结果时返回空列表。")
    R<List<SmsDTO>> page(@Parameter(name = "queryParam", description = "查询条件")
                                @RequestBody SmsQueryParamDTO queryParam);

    @PostRequest(order = 5, value = "/list/all", summary = "全量查询", description = "全量查询，没有查询结果时返回空列表。")
    R<List<SmsDTO>> all();

    @PostRequest(order = 5, value = "/list/all/condition", summary = "全量查询(有条件)", description = "全量查询，没有查询结果时返回空列表。")
    R<List<SmsDTO>> all(@Parameter(name = "queryParam", description = "查询条件")
                        @RequestBody(required = false) SmsQueryParamDTO queryParam);

    @PostRequest(order = 6, value = "/detail/id", summary = "查询详情", description = "查询详情，数据不存在时仍然返回成功,数据为null。")
    R<SmsDTO> detail(@RequestBody String id);

    @PostRequest(order = 8, value = "/send", summary = "发送短信", description = "发送短信")
    R<Object> send(@RequestBody SmsSendMessageParamDTO sendMessageParam);

    @PostRequest(order = 9, value = "/template/list", summary = "获取模板", description = "获取订阅消息模板")
    R<List<SmsTemplateDTO>> listTemplate(@RequestBody String smsId);
}
